using JT808Protocol.Common;
using System;
using System.Collections.Generic;

namespace JT808Protocol.Models.BodyParserStrategy
{
    /// <summary>
    /// 文件上传完成通知
    /// </summary>
    public class DrFileUploadFinished_0x1206 : IJT808Body
    {
        /// <summary>
        /// 流水号
        /// </summary>
        public ushort Sn { get; set; }

        /// <summary>
        /// 结果 0：成功；1：失败
        /// </summary>
        public byte Result { get; set; }

        public override IJT808Body ReadBody(ReadOnlySpan<byte> data, ref int index)
        {
            Sn = ParseHelper.Uint16(ref data, index);
            index += 2;

            Result = data[index];
            return this;
        }

        public override List<byte> WriteToBytes()
        {
            throw new NotImplementedException();
        }
    }
}